﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MvcEngine.Core.Repositories;

using System.Data.Linq;
using MvcEngine.Core;
using MvcEngine.Core.Website;

namespace MvcEngine.LinqToSqlProvider
{
    public class SkinRepository : Repository, ISkinRepository
    {
        public Skin Get(string name)
        {
            using (var contextManager = CreateContextManager(true))
            {
                return contextManager.Context.Skins().Single(s => s.Name == name);
            }
        }
        
        public IList<Skin> GetAll()
        {
            using (var contextManager = CreateContextManager(true))
            {
                return contextManager.Context.Skins().ToList();
            }
        }

        public void Add(Skin entity)
        {
            throw new NotImplementedException();
        }

        public void DeleteAll()
        {
            throw new NotImplementedException();
        }

        public Skin Get(Guid id)
        {
            using (var contextManager = CreateContextManager(true))
            {
                return contextManager.Context.Skins().Single(s => s.Id == id);
            }
        }

        public void Delete(Guid id)
        {
            throw new NotImplementedException();
        }
    }
}
